import { createRouter, createWebHistory } from "vue-router";
// import LoginView from "../views/LoginView.vue";
// import HomeView from "../views/HomeView.vue";
// import DetailView from "../views/DetailView.vue";
// import SearchView from "../views/SearchView.vue";
import NotFound from "../views/NotFound.vue";

const router = createRouter({
    // history:createWebHashHistory(),
    history:createWebHistory(),
    routes:[
        {
            path:'/',
            redirect:'/home'
        },
        {
            path:'/login',
            // component:LoginView
            component:()=>import("../views/LoginView.vue")
        },
        {
            path:'/home/:id?',
            // component:HomeView
            component:()=>import("../views/HomeView.vue")

        },
        {
            path:'/detail/:name/:index',
            // component:DetailView
            component:()=>import("../views/DetailView.vue")

        },
        {
            path:'/search',
            // component:SearchView
            component:()=>import("../views/SearchView.vue")

        },
        {
            path:'/:pathMatch(.*)*',
            component:NotFound
        }
    ]
})
export default router